package com.springboot.jwt.common;

import org.apache.shiro.crypto.hash.Md5Hash;
import org.springframework.util.DigestUtils;

/**
 * @Author: Jyf
 * @Date: 2020/12/17 11:05
 */
public class Test {
    public static void main(String[] args) {
//        String s = DigestUtils.md5DigestAsHex("111111".getBytes());
//        String token = JWTUtils.sign("zhinian", s);
//        String token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MDgxNzQ5MTYsImlhdCI6MTYwODE3NDg1NiwidXNlcm5hbWUiOiJ6aGluaWFuIn0.u3Og9S0numC-wSRDxYHYtR7hq9AvKGHgUY4K1GHn9ZU";
//        System.out.println(token);
//        System.out.println(JWTUtils.verify(token, "zhinian", s));

//        long startTime = System.currentTimeMillis();    //获取开始时间
//        for (int i = 0; i < 1000; i++) {
        String salt = JWTUtils.getSalt();
        Md5Hash md5Hash = new Md5Hash("djioawjifg61", salt, 100);
        System.out.println(md5Hash.toHex());

        md5Hash = new Md5Hash("djioawjifg61", salt, 100);
        System.out.println(md5Hash.toHex());
////            System.out.println(DigestUtils.md5DigestAsHex(("djioawjifg61" + salt).getBytes()));
//        }
//        long endTime = System.currentTimeMillis();    //获取结束时间
//        System.out.println("程序运行时间：" + (endTime - startTime) + "ms");    //输出程序运行时间 361ms 432 378
    }
}
